var rlt2 = new Array(); 
var rlt3 = new Array();
var phone = new Array();
rlt2 = rlt1.split('}');
var j = "";
for(j = 0; j < rlt.size();j++){
	rlt2[j] = rlt2[j].replace(/\W*(.*)/,"$1");
	rlt3[j] = rlt2[j].replace(/\W*(.*)/,"$1");
	rlt2[j] = rlt2[j].replace(/(\d+)={(\w+)_(\w+)=(\d+),(\s*)(\w+)=(.*)/,"$7");
	phone[j] = rlt3[j].replace(/(\d+)={(\w+)_(\w+)=(\d+),(\s*)(\w+)=(.*)/,"$4");
	document.write( "<button type='button'  id='"+j+"' class='contact'>"+rlt2[j]+" </button>");
}

var checked = new Array();
var selected = new Array();
var selectednumber = new Array();
$(document).ready(function(){
	var k = "";
	for(k = 0; k < rlt.size();k++){
		checked[k] = "false";
	}
});

$(document).ready(function(){
	$("button.contact").click(function(){
		var id = this.id;
		if(checked[id].search(/false/)  != -1){
			checked[id] = "true";
			selected[id] = $(this).text();
			selectednumber[id] = phone[id]+" ";
//			$(this).css({"background-color": "green","padding-top":"3px"});
			$(this).fadeTo("slow",0.1);
		}else{
			checked[id] = "false";
			selected[id] = "";
			selectednumber[id] = "";
//			$(this).css({"background-color": "transparent","padding-top":"3px"});
			$(this).fadeTo("slow",1);
		}
	});
});





var sqlrlt = window.lemon.searchTable("select _id from User;");
var sqlrlt1 = new String(sqlrlt);
var begin = sqlrlt1.lastIndexOf(":")+2;
var end = sqlrlt1.lastIndexOf("\"");
var user_id = sqlrlt1.substring(begin,end);
